﻿using JNPF.Saas.Models.BaseTenant.Entities;
using JNPF.Utils;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JNPF.Saas.Logic.Tenant
{
    /// <summary>
    /// 租户信息
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// 日 期：2020.12.21 
    /// </summary>
    internal interface TenantIService
    {
        /// <summary>
        /// 列表(分页)
        /// </summary>
        /// <param name="input">参数</param>
        /// <returns></returns>
        Task<PageResult<TenantEntity>> GetList(PageInput input);
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="input">参数</param>
        /// <returns></returns>
        Task<List<TenantEntity>> GetList();
        /// <summary>
        /// 信息
        /// </summary>
        /// <param name="id">主键id</param>
        /// <returns></returns>
        Task<TenantEntity> GetInfo(string id);
        /// <summary>
        /// 获取租户数据库
        /// </summary>
        /// <param name="phone">主键id</param>
        /// <returns></returns>
        Task<TenantEntity> GetDbContent(string phone);
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        Task<int> Create(TenantEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        Task<int> Update(TenantEntity entity);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        Task<int> Delete(TenantEntity entity);
        /// <summary>
        /// 创建租户数据库
        /// </summary>
        /// <param name="dbName"></param>
        /// <returns></returns>
        Task CreateDB(string dbName);
        /// <summary>
        /// 删除租户数据库
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task DeleteDB(TenantEntity entity);
    }
}
